import {Card, Col, Row} from 'antd';
import {useEffect, useState} from "react";
import {detail} from "./service";
import Ad from "@/pages/news/components/Ad";
import ContentRenderer from "@/components/ContentRenderer";

import SeoHead from "@/components/SeoHead";
import CardTab from "@/pages/news/components/CardTab";

export default () => {
  const [data, setData] = useState<Record<string, any>>({});

  useEffect(() => {
    detail({
      id:7035
    }).then(result => {
      setData(result.data);
    })
  }, []);
  return (
    <>
      <SeoHead
        title={data.name}
        description={data.memo}
        keywords="Ant Design Pro, React, SEO"
        image={data.image}
        url={`http://localhost:8000/news/product/${data.id}`}
      />
      <Row>
        <Col span={2}/>
        <Col span={20}>
          <Row gutter={16}>
            <Col span={20}>
              <Card>
                <h1 style={{
                  lineHeight:'1.5',
                }}>{data.title}</h1>
                <ContentRenderer html={data.content || ''} />
              </Card>
            </Col>
            <Col span={4}>
              <CardTab title='热门工具' type='app' />
              <Ad type='url' url='https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-7941312752144276&output=html&h=250&slotname=4660461353&adk=908470438&adf=3724147500&pi=t.ma~as.4660461353&w=310&abgtt=6&fwrn=4&fwrnh=100&lmt=1754712712&rafmt=1&format=310x250&url=https%3A%2F%2Fai-bot.cn%2Fdaily-ai-news%2F&fwr=0&fwrattr=true&rpe=1&resp_fmts=3&wgl=1&uach=WyJXaW5kb3dzIiwiMTkuMC4wIiwieDg2IiwiIiwiMTM5LjAuMzQwNS44NiIsbnVsbCwwLG51bGwsIjY0IixbWyJOb3Q7QT1CcmFuZCIsIjk5LjAuMC4wIl0sWyJNaWNyb3NvZnQgRWRnZSIsIjEzOS4wLjM0MDUuODYiXSxbIkNocm9taXVtIiwiMTM5LjAuNzI1OC42NyJdXSwwXQ..&dt=1754712712711&bpp=22&bdt=435&idt=22&shv=r20250805&mjsv=m202508050101&ptt=9&saldr=aa&abxe=1&cookie=ID%3D48ecad0f06cf6f6e%3AT%3D1754370184%3ART%3D1754711281%3AS%3DALNI_MbZ4gkf44ZMoZYgvqx7gGCiqX4obA&gpic=UID%3D00001100aad25d64%3AT%3D1754370184%3ART%3D1754711281%3AS%3DALNI_MbQ_7Dboj0XOdCGiUwRYvyOYLtRhw&eo_id_str=ID%3D73e8aaca309ae459%3AT%3D1754370184%3ART%3D1754711281%3AS%3DAA-AfjZ_kO8cvUXtToZ5F-wLmLiK&prev_fmts=0x0&nras=1&correlator=5992132065112&frm=20&pv=1&u_tz=480&u_his=1&u_h=1067&u_w=1707&u_ah=1019&u_aw=1707&u_cd=24&u_sd=1.5&dmc=8&adx=1202&ady=140&biw=1695&bih=941&scr_x=0&scr_y=0&eid=31093040%2C95362655%2C95368228%2C95344789%2C95359266&oid=2&pvsid=6688755762123586&tmod=1016085533&uas=0&nvt=1&ref=https%3A%2F%2Fai-bot.cn%2Ffavorites%2Fai-writing-tools%2F&fc=1920&brdim=0%2C0%2C0%2C0%2C1707%2C0%2C1707%2C1019%2C1699%2C941&vis=1&rsz=%7C%7CleE%7C&abl=CS&pfx=0&fu=128&bc=31&bz=1&td=1&tdf=2&psd=W251bGwsbnVsbCxudWxsLDFd&nt=1&ifi=4&uci=a!4&fsb=1&dtd=25' />
            </Col>
          </Row>
        </Col>
        <Col span={2}/>
      </Row>
    </>
  )
}
